package cn.ggy.demo;

public class ProxyPhone implements Phone{

    //目标对象
    private XiaoMi xiaoMi;

    //再来个有参构造
    public ProxyPhone(XiaoMi xiaoMi){
        this.xiaoMi = xiaoMi;
    }

    public void say() {

        System.out.println("电话铃响了...");  //代理对象里的输出语句
        xiaoMi.say();   //目标对象的方法
        System.out.println("挂断电话...");    //相当于对目标对象进行增强
    }
}
